#ifndef JPINGSOCKET_P_H
#define JPINGSOCKET_P_H

#include "jicmpsocket.h"
#include <QTECore/jlog.h>

#include <QHostAddress>
#include <QHostInfo>

namespace QTE
{

typedef JICMPSocket::PingResponse  JPingResponse;

class JICMPSocketPlatform;

class Q_DECL_HIDDEN JICMPSocketPrivate : public QObject
{
	Q_OBJECT

public:
	explicit JICMPSocketPrivate(JICMPSocket *q_ptr);
	~JICMPSocketPrivate();

public:
	int ping(const QHostAddress &address, int cnt);
	int ping(const QString &domainName, int cnt);

public:
	int waitForPong(JPingResponse &response, int timeout);

public:
	JICMPSocket *q_ptr;
	quint64 m_timeout = 10000;
	QString m_errorString;
	JICMPSocketPlatform *m_platform;
};

class Q_DECL_HIDDEN LookupHost : public QObject
{
	Q_OBJECT

private slots:
	void on_lookupHost(const QHostInfo &info);
};

} //namespace QTE


#endif //JPINGSOCKET_P_H
